import { createRouter, createWebHistory } from "vue-router";
import LessonType from "@/views/lesson/LessonType.vue";
import WorkOrderApply from "@/views/workorder/WorkOrderApply.vue";
// 静态路由
export const constantRoutes = [
  {
    path: "/login",
    component: () => import("@/views/login/LoginView.vue"),
    hidden: true,
  },
  {
    path: "/",
    redirect: "/login", // 重定向
  },
  {
    path: "/home",
    name: "Home",
    component: () => import("@/views/home/homeView.vue"),
  },
  {
    path: "/lesson-type/add",
    name: "LessonTypeAdd",
    component: () => import("@/views/lesson/LessonTypeAdd.vue"),
  },
  {
    path: "/lesson-type/edit",
    name: "LessonTypeEdit",
    component: () => import("@/views/lesson/LessonTypeEdit.vue"),
  },
  {
    path: "/course/add",
    name: "CourseAdd",
    component: () => import("@/views/lesson/CourseAdd.vue"),
  },
  {
    path: "/course/edit",
    name: "CourseEdit",
    component: () => import("@/views/lesson/CourseEdit.vue"),
  },
  {
    path: "/lesson-type/detail",
    name: "LessonTypeDetail",
    component: () => import("@/views/lesson/LessonDetail.vue"),
  },
  {
    path: "/course/detail",
    name: "CourseDetail",
    component: () => import("@/views/lesson/LessonDetail.vue"),
  },
  {
    path: "/404",
    component: () => import("@/views/404"),
    hidden: true,
  },
  {
    path: "/course-types",
    name: "CourseTypes",
    component: LessonType,
  },
  {
    path: "/video-monitor",
    name: "VideoMonitor",
    component: () => import("@/views/monitor/VideoMonitor.vue"),
  },
  {
    path: "/user-manage",
    name: "UserManage",
    component: () => import("@/views/login/UserManage.vue"),
  },
  {
    path: "/warehouse",
    name: "DroneWarehouseHome",
    component: () => import("@/views/DroneWarehouse/DroneWarehouseHome.vue"),
  },
  {
    path: "/warehouse/add",
    name: "WarehouseAdd",
    component: () => import("@/views/DroneWarehouse/WarehouseAdd.vue"),
  },
  {
    path: "/warehouse/edit",
    name: "WarehouseEdit",
    component: () => import("@/views/DroneWarehouse/WarehouseEdit.vue"),
  },
  {
    path: "/uav/add",
    name: "UavAdd",
    component: () => import("@/views/DroneWarehouse/UavAdd.vue"),
  },
  {
    path: "/workorder",
    name: "WorkOrder",
    component: () => import("@/views/workorder/WorkOrderHome.vue"),
  },

  {
    path: "/workorder/apply",
    name: "WorkOrderApply",
    component: WorkOrderApply,
  },
  {
    path: "/workorder/approve",
    name: "WorkOrderApprove",
    component: () => import("@/views/workorder/WorkOrderApprove.vue"),
  },
  {
    path: "/h5/uav-detail",
    name: "DroneDetail",
    component: () => import("@/views/uav/UavDetail.vue"),
  },
  {
    path: "/uav/inbound/add",
    name: "UavInboundAdd",
    component: () => import("@/views/DroneWarehouse/UavInboundAdd.vue"),
  },
  {
    path: "/cloud-network-5g",
    name: "CloudNetwork5G",
    component: () => import("@/views/CloudNetwork/CloudNetwork5G.vue"),
  },
  {
    path: "/picture-manage",
    name: "PictureManage",
    component: () => import("@/views/PictureManage/PictureManage.vue"),
  },
  {
    path: "/uav-photos",
    name: "UavPhotos",
    component: () => import("@/views/PictureManage/UavPhotos.vue"),
  },
  {
    path: "/uav-videos",
    name: "UavVideos",
    component: () => import("@/views/CloudNetwork/UavVideos.vue"),
  },
  {
    path: "/uav/outbound/detail",
    name: "UavOutboundDetail",
    component: () => import("@/views/DroneWarehouse/UavOutboundDetail.vue"),
  },
];

const router = createRouter({
  history: createWebHistory(),
  routes: constantRoutes,
});
export default router;
